package cn.pro.CCY.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class AppJdbcDelete {
    public static void main (String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:13306/test?useSSL=false";
        String user = "root";
        String password = "root";
        Connection connection = DriverManager.getConnection(url, user, password);

        //3.创建陈述句对象
        Statement statement = connection.createStatement();

        //4.
        String sql = "DELETE FROM user where username='cc'";

        int i = statement.executeUpdate(sql);
        if (i>0) {
            System.out.println("删除成功！");
        }
    }
}

